home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group96b.txt / 000012_icon-group-sender _Sun Oct 6 20:16:45 1996.msg < prev    next >
Internet Message Format  |  1997-01-02  |  2KB

  1. Received: by cheltenham.cs.arizona.edu; Mon, 7 Oct 1996 10:15:52 MST
  2. To: icon-group@cs.arizona.edu
  3. Date: Sun, 6 Oct 1996 20:16:45 GMT
  4. From: bezeau@jupiter.sun.csd.unb.ca (Larry Bezeau)
  5. Message-Id: <bezeau.59.844633005@jupiter.csd.unb.ca>
  6. Organization: New Brunswick Centre for Educational Administration
  7. Sender: icon-group-request@cs.arizona.edu
  8. Subject: Parsing the Icon command line
  9. Errors-To: icon-group-errors@cs.arizona.edu
  10.  
  11.     I have been using the Icon language extensively in recent
  12. months and have found it to be a significant improvement over 
  13. Snobol4 which I had used previously for several decades.  But there
  14. is one apparent anomaly that confuses me, and that is how Icon
  15. parses the command line.  The problem arose in a program that
  16. functions somewhat like the DOS find command but the simple three-
  17. liner below illustrates it quite readily.
  18.  
  19.     If the unescaped quotes on the command line are not really
  20. quotes, then where did they go?  What happend to the three spaces
  21. on the command line between "C" and "D"?  I was unable to come up
  22. with a string on the command line that would be written out as
  23. follows:  *cd \
  24.  
  25. h:\>type c:\libicon\cmdline.icn
  26. procedure main(C)
  27.   every write(&output,C[1 to *C])
  28. end
  29.  
  30. h:\>cmdline.exe "A   B"  \"C   D\"
  31. A
  32. B
  33. C D
  34.  
  35. I am doing all this in a DOS window in OS/2 2.1 with the 4DOS command
  36. processor.  Note that 4DOS does not strip double quotation marks from
  37. the command line.
  38.                          Larry  Bezeau@UNB.Ca
  39.